class CartItem < ActiveRecord::Base
  attr_reader:product,:quantity
  
  def initialize(product)
    @product=product
    @quantity=1
  end
  
  def increment_quantity
    @quantity +=1
  end
  
  def product_id
    @product.id
  end
  
  def shop_id
    @product.shop_id
  end
  
  def title
    @product.title
  end
  
  def price
    @product.price*@quantity
  end
  
end
